import java.util.Arrays;
import java.util.Scanner;

public class Day15 {
    public static boolean jud(int[]arr){
        int count=0;
        int i=0;
        while(i!=arr.length){
            if(arr[i]%2!=0){
                count++;
                if(count==3){
                    return true;
                }
            }else{
                count=0;
            }
            i++;
        }
            return false;
    }
    public static void main(String[] args) {
        int arr[]={1,2,3,5,7,10};
        boolean a=jud(arr);
        System.out.println(a);
        int arr1[]={1,2,3,4,5,6};
        a=jud(arr1);
        System.out.println(a);
    }
    public static void main7(String[] args) {
        int[]arr=new int []{1,5,5,5,1};
        Arrays.sort(arr);
        int f=arr[arr.length/2];
        System.out.println(f);
    }
    public static int find(int[]arr){
        int ret=0;
        for (int i = 0; i < arr.length; i++) {
            ret^=arr[i];
        }
        return ret;
    }
    public static void main6(String[] args) {
        int []arr=new int []{1,1,3,2,3};
        int ret=find(arr);
        System.out.println(ret);
    }
    public static String find(int[]arr,int a){
        String ret="[";
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = i; j < arr.length; j++) {
                if(arr[i]+arr[j]==a && i!=j){
                    ret+=i;
                    ret+=",";
                    ret+=j;
                    ret+="]";
                }
            }
        }
        return ret;
    }
    public static void main5(String[] args) {
        int []nums=new int []{2,7,11,15};
        int target=22;
        System.out.println(find(nums,target));
        }
    public static int[] boorSort(int []arr){
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr.length-1-i; j++) {
                if (arr[j] > arr[j+1]){
                   int tmp=arr[j];
                   arr[j]=arr[j+1];
                   arr[j+1]=tmp;
                }
            }
        }
        return arr;
    }
    public static void main4(String[] args) {
        int[]arr=new int []{2,5,1,4,3};
        arr=boorSort(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static int search(int []arr,int a){
        int left=0;
        int right=arr.length;
        int mid=(left+right)/2;
        for (int i = 0; i < arr.length ; i++) {
            if(mid==a){
                return mid;
            }else if(mid>a){
                right=mid-1;
                mid=(left+right)/2;
            }else{
                left=mid+1;
                mid=(left+right)/2;
            }
        }
        return -1;
    }
    public static void main3(String[] args) {
        int arr[]=new int []{1,2,3,4,5,6};
        int ret=search(arr,3);
        System.out.println(ret);
    }
   public static int[] trans(int []arr){
        int left=0;
        int right= arr.length-1;
        int tmp=0;
        while(left<right){
            if(arr[left]%2==1){
                left++;
            }else{
                tmp=arr[left];
                arr[left]=arr[right];
                arr[right]=tmp;
            }
            if(arr[right]%2==0){
                right--;
            }else{
                tmp=arr[right];
                arr[right]=arr[left];
                arr[left]=tmp;
            }
        }
        return arr;
   }
    public static void main2(String[] args) {
        int []arr=new int []{1,2,3,4,5,6};
        System.out.println(Arrays.toString(trans(arr)));
    }
    public static void transrorm(int [] arr){
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]*2+" ");
        }
    }
    public static void main1(String[] args) {
        int[] arr=new int[]{1,2,3};
        transrorm(arr);
    }
}
